//
//  lunboTableViewCell.m
//  lmq
//
//  Created by 千翼网络科技 on 2017/1/13.
//  Copyright © 2017年 yuanxin. All rights reserved.
//

#import "lunboTableViewCell.h"
#import "UIImageView+WebCache.h"

@implementation lunboTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor=DEF_RGB_COLOR(202, 202, 202);

        NSArray *arrMu = @[@"3479.jpg_wh1200",@"3479.jpg_wh1200",@"3479.jpg_wh1200",@"3479.jpg_wh1200",@"3479.jpg_wh1200"];
        self.cycleScrollView=[SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, DEF_SCREEN_WIDTH, (170)) imageNamesGroup:arrMu];
        self.cycleScrollView.backgroundColor=[UIColor whiteColor];
        self.cycleScrollView.pageControlAliment=SDCycleScrollViewPageContolAlimentCenter;
        self.cycleScrollView.delegate = self;
        self.cycleScrollView.pageDotColor = [UIColor whiteColor]; // 自定义分页控件小圆标颜色
        self.cycleScrollView.currentPageDotImage=[UIImage imageNamed:@"banner_yuandian_bai"];
        self.cycleScrollView.pageDotImage=[UIImage imageNamed:@"banner_yuandian_hei"];
        self.cycleScrollView.placeholderImage = [UIImage imageNamed:@""];
        //禁止自动滚动
//        self.cycleScrollView.autoScroll = NO;
        
        [self addSubview:self.cycleScrollView];

    }
    return self;
}

#pragma mark - SDCycleScrollViewDelegate
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index
{
    NSLog(@"---点击了第%ld张图片", (long)index);
    

}

-(void)updateInfo:(NSArray*)SDCycleArr{
    NSMutableArray *myarr=[[NSMutableArray alloc]init];
    for (int i=0; i<SDCycleArr.count; i++) {
        
        NSString *str=[SDCycleArr[i] objectForKey:@"pic"];
        NSString *urlN=manage(AP_HOST, str);

        [myarr addObject:urlN];
    }
    [self.cycleScrollView setLocalizationImageNamesGroup:myarr];
    [self.cycleScrollView reloadInputViews];
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
